AT-NFC  2.1 (win)
AT-NFC kernel set
Data Structures | Typedefs | Functions
Kernel TLV container usage API

Process all EMV TLV data as contaner lists. More...

Data Structures

struct  tag_KER_TLV
 TLV container structure. More...
 

Typedefs

typedef struct tag_KER_TLV KER_TLV
 TLV container structure. More...
 

Functions

KER_RES KER_API kerContTlvCreateByTag (KER_CTX_PARAM const KER_BYTE *pbtTag, KER_BYTE btTagLen, const KER_BYTE *pbtValue, KER_INT16U usValueLen, KER_TLV **ppTlv)
 Creates TLV container structure from provided tag & value. More...
 
KER_RES KER_API kerContTlvCreateByTLV (KER_CTX_PARAM const KER_BYTE *pbtTlv, KER_INT16U usTlvLen, KER_TLV **ppTlv)
 Creates TLV container structure from provided TLV buffer. More...
 
KER_RES KER_API kerContTlvListAddByTLV (KER_CTX_PARAM const KER_BYTE *pbtTlv, KER_INT16U usTlvLen, KER_TLV **ppTlv)
 Creates TLV container structure from provided TLV buffer and addes it to provided TLV List. More...
 
KER_BOOL KER_API kerContTlvRelease (KER_CTX_PARAM KER_TLV *pTlv)
 Releases TLV container structure. More...
 
KER_BOOL KER_API kerContTlvListRelease (KER_CTX_PARAM KER_TLV *pTlvList)
 Releases TLV container structure list. More...
 
KER_BOOL KER_API kerContTlvListPush (KER_CTX_PARAM KER_TLV **ppTlv, KER_TLV *pTlvToPush)
 Add TLV container structure to list (to the start of list) More...
 
KER_BOOL KER_API kerContTlvListPushLast (KER_CTX_PARAM KER_TLV **ppTlv, KER_TLV *pTlvToPush)
 Add TLV container structure to list (to the end of list) More...
 
KER_TLV *KER_API kerContTlvListGetNext (KER_CTX_PARAM KER_TLV *pTlvListEntry)
 Returns next TLV container structure in list. More...
 
KER_BOOL KER_API kerContTlvListPop (KER_CTX_PARAM KER_TLV **ppTlv, KER_TLV *pTlvToPop)
 Pop TLV container structure from list. More...
 

Detailed Description

Process all EMV TLV data as contaner lists.

Typedef Documentation

◆ KER_TLV

typedef struct tag_KER_TLV KER_TLV

TLV container structure.

Termial application should use it:

  • to obtain CL (one struct per candidate) with app-related tlv data;
  • to obtain blocked app list (one struct with 9F06 tag per blocked app)

Function Documentation

◆ kerContTlvCreateByTag()

KER_RES KER_API kerContTlvCreateByTag ( KER_CTX_PARAM const KER_BYTE pbtTag,
KER_BYTE  btTagLen,
const KER_BYTE pbtValue,
KER_INT16U  usValueLen,
KER_TLV **  ppTlv 
)

Creates TLV container structure from provided tag & value.

Parameters
[in]pbtTag- buffer with tag to set
[in]btTagLen- pbtTag buffer length
[in]pbtValue- buffer with value, assosiated with pbtTag to set
[in]usValueLen- pbtValue buffer length
[out]ppTlv- pointer to created TLV container structure
Returns
KER_OK Success
KER_ERR_TLV_CONT_CREATE_BY_TAG_INV_PARAM Invalid parameter
KER_ERR_TLV_CONT_CREATE_BY_TAG_ALLOC_MEM Allocate memory failure
KER_ERR_TLV_CONT_CREATE_BY_TAG_INV_DATA Invalid data format
Warning
Allocated container list must be added to container list or released by kerContTlvRelease

◆ kerContTlvCreateByTLV()

KER_RES KER_API kerContTlvCreateByTLV ( KER_CTX_PARAM const KER_BYTE pbtTlv,
KER_INT16U  usTlvLen,
KER_TLV **  ppTlv 
)

Creates TLV container structure from provided TLV buffer.

Parameters
[in]pbtTlv- TLV buffer to set
[in]usTlvLen- pbtTLV buffer lenght
[out]ppTlv- pointer to created TLV container structure
Returns
KER_OK Success
KER_ERR_TLV_CONT_CREATE_BY_TLV_INV_PARAM Invalid parameter
KER_ERR_TLV_CONT_CREATE_BY_TLV_ALLOC_MEM Allocate memory failure
KER_ERR_TLV_CONT_CREATE_BY_TLV_INV_DATA Invalid data format
Warning
Allocated container must be added to other list or released by kerContTlvRelease

◆ kerContTlvListAddByTLV()

KER_RES KER_API kerContTlvListAddByTLV ( KER_CTX_PARAM const KER_BYTE pbtTlv,
KER_INT16U  usTlvLen,
KER_TLV **  ppTlv 
)

Creates TLV container structure from provided TLV buffer and addes it to provided TLV List.

Parameters
[in]pbtTlv- TLV buffer to set
[in]usTlvLen- pbtTLV buffer lenght
[out]ppTlv- pointer to TLV list to add to
Returns
KER_OK Success
KER_ERR_TLV_CONT_CREATE_BY_TLV_INV_PARAM Invalid parameter
KER_ERR_TLV_CONT_CREATE_BY_TLV_INV_PARAM Invalid parameter
KER_ERR_TLV_CONT_CREATE_BY_TLV_ALLOC_MEM Allocate memory failure
KER_ERR_TLV_CONT_CREATE_BY_TLV_INV_DATA Invalid data format
Warning
Allocated container must be released within list added to...

◆ kerContTlvListGetNext()

KER_TLV* KER_API kerContTlvListGetNext ( KER_CTX_PARAM KER_TLV pTlvListEntry)

Returns next TLV container structure in list.

Parameters
[in]pTlvListEntry- pointer to the tlv structure entry to get next entry from
Returns
KER_NULL No more entries in the list.
Pointer to next entry.

◆ kerContTlvListPop()

KER_BOOL KER_API kerContTlvListPop ( KER_CTX_PARAM KER_TLV **  ppTlv,
KER_TLV pTlvToPop 
)

Pop TLV container structure from list.

Parameters
[in]ppTlv- pointer to the tlv structure list to update
[in]pTlvToPop- pointer to the tlv structure to Pop
Returns
KER_TRUE Success.
KER_FALSE Failure. Execution failed due to invalid param or tlv structure not in list.
Warning
Extracted TLV should be added to other tlv list or released by kerContTlvRelease

◆ kerContTlvListPush()

KER_BOOL KER_API kerContTlvListPush ( KER_CTX_PARAM KER_TLV **  ppTlv,
KER_TLV pTlvToPush 
)

Add TLV container structure to list (to the start of list)

Parameters
[in]ppTlv- pointer to the tlv structure list to update
[in]pTlvToPush- pointer to the tlv container (or container list) to Add
Returns
KER_TRUE Success.
KER_FALSE Failure. Execution failed due to invalid param.
Warning
Added container (container list) should be released with the updated container list

◆ kerContTlvListPushLast()

KER_BOOL KER_API kerContTlvListPushLast ( KER_CTX_PARAM KER_TLV **  ppTlv,
KER_TLV pTlvToPush 
)

Add TLV container structure to list (to the end of list)

Parameters
[in]ppTlv- pointer to the tlv structure list to update
[in]pTlvToPush- pointer to the tlv container (or container list) to Add
Returns
KER_TRUE Success.
KER_FALSE Failure. Execution failed due to invalid param.
Warning
Added container (container list) should be released with the updated container list

◆ kerContTlvListRelease()

KER_BOOL KER_API kerContTlvListRelease ( KER_CTX_PARAM KER_TLV pTlvList)

Releases TLV container structure list.

Parameters
[in]pTlvList- pointer to the list îf containers, allocated by kerContTlvCreateByTag or kerContTlvCreateByTLV
Returns
KER_TRUE Success.
KER_FALSE Failure. Execution failed due to invalid param or memory error.
Warning
Function releases whole container list, starting from pTlvList container.

◆ kerContTlvRelease()

KER_BOOL KER_API kerContTlvRelease ( KER_CTX_PARAM KER_TLV pTlv)

Releases TLV container structure.

Parameters
[in]pTlv- pointer to the container, allocated by kerContTlvCreateByTag or kerContTlvCreateByTLV
Returns
KER_TRUE Success.
KER_FALSE Failure. Execution failed due to invalid param or memory error.
Warning
Function releases single container.